I am facing the same issue. I want to get html from plugin folder but the system is finding the html in default umbraco view folder. How can I change the path of the file. I have set the route as showing in "Marcel Van" comment. It works when we add file in umbraco/view folder but I want to change the file path.
normally you would use
FormDataCollectionExtensions.GetValue<string>(queryStrings, "application") + _treeAlias.EnsureStartsWith('/') + "/viewName/" + someId.ToString()
With that it would try to resolve the view under App_Plugins/ApplicationFolder/backOffice/treeAlias/viewName.html
This means that my all my views have to be here:
App_Plugins/Rewards/backoffice/rewardsTree/editopco.html
But I want to put my organise my views like this (all views to do with 'opco' to be in one folder)
App_Plugins/Rewards/backoffice/rewardsTree/views/opco/edit.html
ok, then the only other way to separate is to have multiple trees in your section as then each tree would at least have its own folder which you can use to separate your views.
the "backOffice" part will be added automatically. You don't need to add it.
So as in my example you concatenate the application alias, the tree alias, the view name without the extension and then the id of the item to edit. If you want to use an overview page you still have to add something as the "id". I just use "all" for that.
as said it only works when you add something like an id at the end. So try to add "/new" or something to your url.
Also, check if your application outcome is the same as the folder that your files are in and check if the tree alias is also set to jobs. Could also be case sensitive. So control the spelling.
Custom url for TreeNode click [v 7.1.6]
Hello,
I have created my own app Tree in the Umbraco backend. However, I don't manage to get to a custom url when clicking on the TreeNode element.
The custom url points me always to /App_Plugins/mySection/backoffice/mySectionTree/edit.html. How can I achive a redirection to a custom url?
Thanks in advance,
mannyk
Hi,
there is an additional parameter for the CreateTreeNode-Method which you can use to set the path to your file.
So after the boolean property, just add another one with the path.
Hope that helps.
David
Hello,
yes, I know that parameter, but I was not able to go to a different url by using it.
Let's say I want to navigate to /umbraco/myfolder/mypage.aspx.
If I am using this as my route path umbraco tries to route me to views/umbraco/myfolder/mypage.aspx.html.
Can you or someone else tell me how to properly use this route path?
Thank you very much,
mannyk
You can't use aspx pages while doing that.
Umbraco reqiures just plain html files for your views, thats why he automatically adds the .html to the end.
Thats becauso the views in v7 are just plain html files with angularjs for the functionality and umbracp api calls to save and load data in
Maybe take a look here: http://umbraco.github.io/Belle/#/tutorials.
There are some tutorials on how to wire everything together.
You can do this.. so you get a url like http://localhost/umbraco/#/mySection/mySectionTree/editCategorie/1010
Hi Marcel,
Thank you very much. I searched lots of sites for this solution and finally I find your solution. Its amazing....
Thanks again.
Regards:
Sabin
Hello,
thank you very much! I I was now able to route to a custom html file that later will redirect me to the specified aspx page.
Regards,
mannyk
Ok, I know it's an old topic, but I'm having the same problem and can't route to my custom html file.
What's the folder structure should be in App_Plugins folder?
I get a 404 error and it looks like Umbraco is looking for my path in umbraco\views folder
Hi,
I am facing the same issue. I want to get html from plugin folder but the system is finding the html in default umbraco view folder. How can I change the path of the file. I have set the route as showing in "Marcel Van" comment. It works when we add file in umbraco/view folder but I want to change the file path.
Please suggest.
Thanks
Hi Manish,
normally you would use
FormDataCollectionExtensions.GetValue<string>(queryStrings, "application") + _treeAlias.EnsureStartsWith('/') + "/viewName/" + someId.ToString()
With that it would try to resolve the view under App_Plugins/ApplicationFolder/backOffice/treeAlias/viewName.html
Regards David
App_Plugins/ApplicationFolder/backOffice/treeAlias/viewName.html
What if you wanted to add 'SomeFolder' so you can organise the views, do you know how I could do that?
so.. like this.. App_Plugins/ApplicationFolder/backOffice/treeAlias/someFolder/viewName.html
Hi Ayo,
it should just work when adding the folder to the route. Umbraco uses the route as path on file system.
Have you tried it?
Regards David
trying it now, i'll update this shortly. Thanks.
Hi David,
Its been a bit fustrating...
This works
The name of my view is editopco.html
This means that my all my views have to be here: App_Plugins/Rewards/backoffice/rewardsTree/editopco.html
But I want to put my organise my views like this (all views to do with 'opco' to be in one folder) App_Plugins/Rewards/backoffice/rewardsTree/views/opco/edit.html
So I try to get to that view like this:
Which genrates this HTML
Which seems right to me... but when you click it, Umbraco redirects me to the content section of the Umbaco UI.......
Been stuck on this for a while now, might have to just put all the views in the same folder.
Hi Ayo,
ok, then the only other way to separate is to have multiple trees in your section as then each tree would at least have its own folder which you can use to separate your views.
Regards David
Hi David,
Thanks for your reply.
I am getting following message when I am trying to get page from App_plugin folder.
nodes.Add(CreateTreeNode(leftLink.Id + "", id, queryStrings, leftLink.Name, "icon-bird", false, FormDataCollectionExtensions.GetValue
I want to create browser url like this "http://localhost:49828/umbraco#/createjob"
this url should access the page in App_Plugin folder.
Thanks
Hi Manish,
the "backOffice" part will be added automatically. You don't need to add it.
So as in my example you concatenate the application alias, the tree alias, the view name without the extension and then the id of the item to edit. If you want to use an overview page you still have to add something as the "id". I just use "all" for that.
Regards David
Hi David,
I am passing url like this and getting url in browser like this : http://localhost:49828/umbraco#/myapp/jobs/addjob
Do I need to set route url also to map with App_plugins file. I am still getting same error.
Please suggest.
Regards Manish
Hi Manish,
as said it only works when you add something like an id at the end. So try to add "/new" or something to your url.
Also, check if your application outcome is the same as the folder that your files are in and check if the tree alias is also set to jobs. Could also be case sensitive. So control the spelling.
Regards David
Thanks David,
It works with Id param.
can we customize the route.js if I want to remove id from url for App_plugins files.
Regards Manish
Hi Manish,
not sure if something like a route.js exists but if it's umbraco internals then I wouldn't recommend to change it.
Normally something like this is done by having a menu item like "Create Job" and some kind of "Jobs" node. So it depends on what you try to achieve.
Regards David
is working on a reply...